package jdk8.functions;

import java.util.function.Consumer;

public class DemoConsumer {
    public static void main(String[] args) {
        consumeString(s -> System.out.println(s));

        consumeString(
                s -> System.out.println(s.toUpperCase()),
                s -> System.out.println(s.toLowerCase())
        );
    }

    private static void consumeString(Consumer<String> consumer){
        consumer.accept("Hello world");
    }

    private static void consumeString(Consumer<String> one, Consumer<String> two){
        one.andThen(two).accept("hello");
    }
}
